//
//  MenuView.m
//  OpenYourEyes
//
//  Created by apple on 15/8/12.
//  Copyright (c) 2015年 zhanglei. All rights reserved.
//

#import "MenuView.h"
#import "Header.h"


@implementation MenuView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.saveBtn];
        [self addSubview:self.downloadBtn];
        [self addSubview:self.functionOnOff];
        [self addSubview:self.edition];
        [self addSubview:self.editionAll];
    }
    return self;
}
/**
 *  我的收藏
 *
 *  @return 我的收藏
 */
- (UIButton *)saveBtn
{
    if (!_saveBtn) {
        self.saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _saveBtn.frame = CGRectMake((SCREEN_WIDTH - 210) / 2, 50, 210, 30);
        [_saveBtn setTitle:@"我的收藏" forState:UIControlStateNormal];
        [_saveBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    }
    return _saveBtn;
}
/**
 *  我的缓存
 *
 *  @return 我的缓存
 */
- (UIButton *)downloadBtn
{
    if (!_downloadBtn) {
        self.downloadBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _downloadBtn.frame = CGRectMake(_saveBtn.left, _saveBtn.bottom + 50, _saveBtn.width, _saveBtn.height);
        [_downloadBtn setTitle:@"我的缓存" forState:UIControlStateNormal];
        [_downloadBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    }
    return _downloadBtn;
}
/**
 *  功能开关
 *
 *  @return 功能开关
 */
- (UIButton *)functionOnOff
{
    if (!_functionOnOff)
    {
        self.functionOnOff = [UIButton buttonWithType:UIButtonTypeCustom];
        _functionOnOff.frame = CGRectMake(_downloadBtn.left, _downloadBtn.bottom + 50, _downloadBtn.width, _downloadBtn.height);
        [_functionOnOff setTitle:@"功能开关" forState:UIControlStateNormal];
        [_functionOnOff setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    }
    return _functionOnOff;
}
/**
 *  版本
 *
 *  @return 版本
 */
- (UILabel *)edition
{
    if (!_edition)
    {
        self.edition = [[UILabel alloc] initWithFrame:CGRectMake(_functionOnOff.left, _functionOnOff.bottom + 70, _functionOnOff.width, _functionOnOff.height)];
        self.edition.text = @"Version 1.1.0";
        self.edition.font = [UIFont systemFontOfSize:14];
        self.edition.textAlignment = NSTextAlignmentCenter;
        self.edition.textColor = [UIColor grayColor];
    }
    return _edition;
}
/**
 *  版本所有权
 *
 *  @return 版本所有权
 */
- (UILabel *)editionAll
{
    if (!_editionAll)
    {
        self.editionAll = [[UILabel alloc] initWithFrame:CGRectMake(_edition.left, _edition.bottom + 30, _edition.width, _edition.height)];
        self.editionAll.text = @"-版权所有:SEEWORLD-";
        
        self.editionAll.font = [UIFont fontWithName:@"Arial-ItalicMT" size:14];
        self.editionAll.textAlignment = NSTextAlignmentCenter;
        self.editionAll.textColor = [UIColor grayColor];
    }
    return _editionAll;
}

@end
